﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>董事设置</title>
<link href="__PUBLIC__/admin/css/xc.min.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/admin/css/xc.admin.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/lib/iconfont/iconfont.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/xc.js"></script> 
<script type="text/javascript" src="__PUBLIC__/admin/js/xc.admin.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/common-1.0.js"></script> 
<script type="text/javascript" src="__PUBLIC__/lib/layer/layer.js"></script>
</head>
<body>
<nav class="breadcrumb">
  <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 系统管理 <span class="c-gray en">&gt;</span> 董事参数设置
  <a class="btn btn-success radius r mr-20 btn-shua" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="pd-20">
  <div id="tab-system" class="HuiTab">
    <div class="tabBar cl">
      <foreach name="set_nav" item="vo" key="k">
        <span <if condition="$k eq 'sDire'">class="current"</if>><a href="javascript:void(0)" data-url="{:U('/Admin/Setup/index',array('type'=>$k))}" onclick="goset(this)">{$vo}</a></span>
      </foreach>     
    </div>
    <form action="" method="post" class="form form-horizontal" id="myform">
      <div class="tabCon">
        <div class="Huialert Huialert-info mt-10">※董事分红参数设置※</div>
        <div class="row cl">
          <label class="form-label col-2"><span class="c-red">*</span>一星董事：</label>
          <div class="formControls col-8">
            <span>分红金额</span>
            <input type="text" id="director1" name="director1" value="{$conf.director1}" class="input-text" style="width:10%; text-align:center">
            <span>元。</span>
            <span>每人可得{$d1count}元。</span>
          </div>
        </div>
        <div class="row cl">
          <label class="form-label col-2"><span class="c-red">*</span>二星董事：</label>
          <div class="formControls col-8">
            <span>分红金额</span>
            <input type="text" id="director2" name="director2" value="{$conf.director2}" class="input-text" style="width:10%; text-align:center">
            <span>元。</span>
            <span>每人可得{$d2count}元</span>
          </div>
        </div>
        <div class="row cl">
          <label class="form-label col-2"><span class="c-red">*</span>三星董事：</label>
          <div class="formControls col-8">
            <span>分红金额</span>
            <input type="text" id="director3" name="director3" value="{$conf.director3}" class="input-text" style="width:10%; text-align:center">
            <span>元。</span>
            <span>每人可得{$d3count}元</span>
          </div>
        </div>
        <!--<div class="row cl">
          <label class="form-label col-2"><span class="c-red">*</span>四星董事：</label>
          <div class="formControls col-8">
            <span>分红金额</span>
            <input type="text" id="director4" name="director4" value="{$conf.director4}" class="input-text" style="width:10%; text-align:center">
            <span>元。</span>
             <span>每人可得{$d4count}元</span>
          </div>
        </div>
        <div class="row cl">
          <label class="form-label col-2"><span class="c-red">*</span>五星董事：</label>
          <div class="formControls col-8">
            <span>分红金额</span>
            <input type="text" id="director5" name="director5" value="{$conf.director5}" class="input-text" style="width:10%; text-align:center">
            <span>元。</span>
             <span>每人可得{$d5count}元</span>
          </div>
        </div>-->
        <div class="col-10 col-offset-2">
          <input type="hidden" id="type" name="type" value="{$type}">
          <button type="button" id="sub" name="sub" class="btn btn-primary radius " onClick="checkSubmit()" style="margin-top: 20px"><i class='Hui-iconfont'>&#xe632;</i>&nbsp;保存</button>
        </div>
      </div>
    </form>
    <form action="" method="post" class="form form-horizontal" id="myformTurn" style="padding-top: 50px">
      <div class="row cl">
        <div class="col-10 col-offset-2">
          <button type="button" id="sub1" name="sub1" class="btn btn-danger radius " onClick="checkSubmitTurn()"><i class='Hui-iconfont'></i>&nbsp;分红发放</button>
        </div>
      </div>
    </form>
  </div>
</div>
<script type="text/javascript">
//按回车件触发提交
document.onkeydown=function(event){
	var e = event || window.event || arguments.callee.caller.arguments[0];
	if(e && e.keyCode==13){ // enter 键
		checkSubmit();
	}
}; 
//提交数据
function checkSubmit()
{
	var input = document.getElementsByTagName("input");
	for(var i=0;i<input.length;i++){
		if(input[i].value=="" || input[i].value==null){
			layer.msg('请填写所有的空格！', {icon: 2});
			return false;
		}
	}
	$.ajax({
		type : 'post',
		url : "{:U('Setup/setupUpdate')}",
		data : $("#myform").serialize(),
		dataType : 'json',
		success : function(res){
			if(res.status == 1){
				layer.msg(res.msg,{icon:1},function(){
					window.location.href = res.url;
				});
			}else{
				layer.msg(res.msg, {icon: 2});
			}
		},
		error : function(XMLHttpRequest, textStatus, errorThrown) {
			layer.alert('网络失败，请刷新页面后重试',{icon:2});
		}
	})
}
function checkSubmitTurn()
{
  var input = document.getElementsByTagName("input");
  for(var i=0;i<input.length;i++){
    if(input[i].value=="" || input[i].value==null || input[i].value==null){
      layer.msg('请填写所有的空格！', {icon: 2});
      return false;
    }
  }
  $.ajax({
    type : 'post',
    url : "{:U('Setup/bonus')}",
    data : $("#myformTurn").serialize(),
    dataType : 'json',
    success : function(res){
      if(res.status == 1){
        layer.msg(res.msg,{icon:1});
        location.reload();
      }else{
        layer.msg(res.info, {icon: 2});
      }
    },
    error : function(XMLHttpRequest, textStatus, errorThrown) {
      layer.alert('网络失败，请刷新页面后重试',{icon:2});
    }
  })
}
</script>
<!-- 单选 复选框 -->
<link href="__PUBLIC__/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/lib/icheck/jquery.icheck.min.js"></script>
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
});
</script>
<!-- 单选 复选框 -->
</body>
</html>